<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title></title>
    <script src="${pageContext.request.contextPath }/js/xtree.js"></script>
	<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath }/css/xtree.css">
  </head>
  <body>
  <script type="text/javascript">
  	<c:forEach var="c" items="${category}">
			
			<c:if test="${c.depth == 1}">
				var tree = new WebFXTree('${c.name}');
				tree.action = "${pageContext.request.contextPath}/servlet/HtCategoryServlet?method=item&id=${c.id}";
				tree.target = "right";
			</c:if>
			<c:if test="${c.depth == 2}">
				var node${c.depth} = new WebFXTreeItem('${c.name}');
				tree.add(node${c.depth});
				node${c.depth}.action = "${pageContext.request.contextPath}/servlet/HtCategoryServlet?method=item&id=${c.id}";
				node${c.depth}.target = "right";
			</c:if>
			<c:if test="${c.depth > 2}">
				var node${c.depth} = new WebFXTreeItem('${c.name}');
				node${c.depth-1}.add(node${c.depth});
				node${c.depth}.action = "${pageContext.request.contextPath}/servlet/HtCategoryServlet?method=item&id=${c.id}";
				node${c.depth}.target = "right";
			</c:if>
		</c:forEach>
		document.write(tree);
  </script>
  </body>
</html>
